<?php
namespace app\index\model;

use think\Model;
use traits\model\SoftDelete;

class User extends Model{
    use SoftDelete;
    //定义软删除模型
    protected  $autoWriteTimestamp='timeStamp';  //timeStamp不能写为 true
    protected static $deleteTime = 'delete_time';
    protected $updateTime = null;
    protected $createTime = 'create_time';

    protected function getRoleAttr($v){
        $role = [
            1   =>  "超级管理员",
            2   =>  "学生处负责人",
            3   =>  "班主任",
            4   =>  "考试考证中心负责人",
            5   =>  "考试考证中心老师",
            6   =>  "教务处负责人",
            7   =>  "教师",
            8   =>  "督查办老师",
            9   =>  "就业办老师"
        ];
        return $role[$v];
    }

    protected function getSexAttr($v){
        $sex = [
            1   =>  "男",
            0   =>  "女"
        ];
        return $sex[$v];
    }
}